<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ProMRDS Sample Updates</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="Trevor Taylor, Software Technology" />
<meta name="keywords" content="Microsoft Robotics Developer Studio, MRDS, Sample Updates" />
<meta name="description" content="Update info for ProMRDS book" />
<link href="Styles/Standard.css" rel="stylesheet" type="text/css" />
</head>
<body>
<img src="Images/ProMRDSBookSmall.BMP" alt="Book Image" align="right" style="margin:0; padding:0;" />
<table width="80%">
<tr>
<td width="200"><a href="http://www.ProMRDS.com"><img src="Images/HomeIcon.gif" alt="ProMRDS Home Page" border="0" /></a></td>
<td width="*" align="center"><img src="Images/Updates.gif" alt="Updates" /></td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
</table>

<div class="page">
<p class="heading"><span class="smallhead">Professional</span><br />&nbsp;&nbsp;&nbsp;Microsoft Robotics Developer Studio<br />
<a href="http://www.ProMRDS.com" onmouseout="Home.src='Images/Home.gif';" onmouseover="Home.src='Images/Home_f2.gif';"><img name="Home" src="Images/Home.gif" width="150" height="25" border="0" alt="Home Page" /></a>
<a href="ReadMe.htm" onmouseout="Contents.src='Images/Contents.gif';" onmouseover="Contents.src='Images/Contents_f2.gif';"><img name="Contents" src="Images/Contents.gif" width="150" height="25" border="0" alt="Book Contents" /></a><br />
</p>

<h1>IMPORTANT NOTE</h1>
<p>
The latest version of the ProMRDS Samples was built for
the official release of Microsoft RDS 2008 R2 (Build 2.1.61.2). It has some restrictions which are explained below.
</p>

<h1>Release Notes for RDS 2008 R2</h1>

<p>
These notes are for the 2008 R2 version. You should also read the notes for the 2008 version
(at the end of this page) which are still applicable.
</p>

<h2>Installing the R2 Package</h2>

<p>
For this release, the samples are provided as a ZIP file rather than a
DssDeploy package. This allows the code to be moved between versions of RDS,
but it also makes installation more complicated. Please follow the
installation instructions below carefully:
</p>
<ol>
<li>Unzip the package into your RDS installation folder. This should create
a ProMRDS folder containing all of the samples. Do <b>NOT</b> unzip it somewhere
else on your hard drive because the code will not compile correctly.</li>
<li>Open a DSS Command Prompt and change directory to ProMRDS.</li>
<li>Run the script <b>setup.cmd</b>. This copies the necessary files to the
<b>store\media</b> folder and to the <b>bin</b> folder.</li>
<li>You now need to build the sample. (See the next section).</li>
</ol>

<h2>Building the Samples</h2>

<p>
There are new batch scripts called <b>clean.cmd</b> that can be used to clean out all of
the binaries to reduce the size before zipping.
</p>
<p>
The binaries are not included in the ZIP file. Each of the folders contains a script
called buildall.cmd that can be used to recompile the samples.
</p>

<p>
When building, you might have to build twice for some projects due to
dependencies. Do NOT issue a Rebuild (which is what buildall.cmd does)
because this deletes the binary files. Just open the solution in
Visual Studio and Build twice.
</p>

<p>
DssProxy issus a warning about schemas.tempuri.org which can be ignored.
(These errors can easily be fixed, but the relevant code was generated
by the Wizard and so it is "correct").
</p>

<p>
Some CF (Compact Framework) projects do not compile. The Express Edition
does not support CF anyway. If you have no need for CF versions then just
delete the projects from the Solution files and the errors will disappear.
</p>

<p>
Sometimes there will be errors similar to (especially for CF projects):<br />
Could not load file or assembly 'file:xxx.dll' or one of its dependencies.<br />
The process cannot access the file because it is being used by another process.<br />

These errors are caused by Visual Studio holding a file open. If you run
the build again they will disappear.
</p>

<h2>General Notes</h2>
<p>
For the simulated webcam, the contract identifier has changed to:<br />
schemas.tempuri.org => schemas.microsoft.com
</p>
<p>
The Corobot has not been updated to the new Generic Differential Drive
contract (from RDS 2008). The DriveDistance and RotateDegrees operations do not send a
response until the operation has completed. They should send an immediate
response and then send a notification when the operation completes.
</p>
<p>
The Soccer samples will not build because they require code that is not included in the
RDS pacakge.
</p>
<p>
Some of the VPL samples, e.g. the Laser Range Finder in Chapter 11, display error messages
in VPL. However they still run as expected. The problem is in how VPL checks for errors,
not in the sample code.
</p>

<p>
&nbsp;
</p>

<hr />

<h1>Release Notes for RDS 2008</h1>

<h2>Visual Studio 2008 Required</h2>
<p>
All of the samples have been compiled using Visual Studio 2008 with Service Pack 1 installed.
They are no longer supplied as VS2005 solutions.
</p>
<p>
If you do not currently have Visual Studio 2008, you should upgrade. There are 
    free Express Editions of VS2008. However, the Express Editions cannot be used to 
    develop Compact Framework services.
</p>
<p>
    The first time that you open a VS2005 solution in VS2008 it will migrate the 
    solution. This is a one-way process and you cannot (easily) go back to VS2005.
</p>

<h2>Recompiling</h2>
<p>
    The kit contains all of the binary files (services) which are copied into the 
    RDS bin folder. However, you can completely rebuild from the sources using the 
    command script called <b>buildall.cmd</b> in the ProMRDS folder. Note that due to some 
    inter-dependencies it is necessary to run buildall <b>twice</b>. Also, there 
    will be errors reported because of the CF services. (See below).
</p>

<h2>VPL Samples</h2>
<p>
    When you first open a VPL diagram from a previous version of RDS in the RDS 
    2008, a dialog is displayed asking if you want to upgrade. All of the VPL 
    diagrams in this package have already been opened and saved so you will not see 
    this message.
    </p>
<h2>Compact Framework Services</h2>
<p>
Due to changes to DssProxy and the way that CF projects are
compiled under RDS 2008, they are <b>not</b> supported in this
interim release. We are working to resolve this problem.
</p>
    <p>
        Also, you should be aware that CF projects are <b>not</b> supported if you are using:<br />
        RDS 2008 Express Edition; OR VS2008 Express Edition; OR VS2008 Standard Edition.</p>
    <p>
        If you have a requirement to create CF services, you must have RDS Academic or 
        Standard Edition and VS2008 Professional Edition or higher.</p>

<h2>DssHost32</h2>
<p>
In previous versions of RDS, simulation was not supported on 64-bit operating 
    systems. (The problem is actually in XNA). In RDS 2008 Microsoft shipped a new version of DssHost.exe
called DssHost32.exe. This allows the Simulator to be run in
a 32-bit environment so it is now possible to use the Simulator
on 64-bit operating systems.
</p>
<p>
This has two consequences:
</p>
<ul>
<li>
The command scripts for running the samples have been modified to run
DssHost32 where appropriate; and
</li>
<li>
The Project Properties for many of the samples have been changed so that
DssHost32.exe is run as the external program when you start the debugger.
</li>
</ul>
<p>
If you have trouble running any of the services that involve
simulation and you are on a 64-bit operating system, please
confirm that you are running DssHost32.
</p>
<p>
Another scenario that might require DssHost32 is if you use a Game Controller in your service.
In particular, this applies to the Dashboard, DriveByWire and TeleOperation in Chapter 4.
</p>

<h2>iRobot Create</h2>
<p>
It has been discovered that the iRobot Create expects <b>both</b> a negative
distance and a negative wheel power in order to move backwards in
response to a DriveDistance request. Logically this is not correct.
Therefore the Backwards arrow in the Dashboard, DriveByWire and TeleOperation
is not functional for a Create. This does not affect other robots.
</p>

<h2>Simulation</h2>

<h3>Lynxmotion L6 Arm Simulation</h3>
<p>
Due to the way that the simulator handles "gripping" an object, you might encounter some strange
behavior with the L6 Arm simulation. If you grip an object too hard, the arm can be thrown back
explosively and the object might fly away. This occurs because the simulator exerts a force
to push objects apart if they try to occupy the same space.
</p>

<h3>Pioneer Simulation</h3>
<p>
In RDS 2008 the wheels were removed from the mesh for the Pioneer 3DX
    (and created separately) which meant that they were not visible in the Pioneer robots created
using SimulatedDifferentialDriveTT. This has been corrected in the Maze Simulator,
but has been left as a novelty in some of the other samples.
</p>

<h3>Soccer</h3>
<p>
The Soccer simulation is not yet supported by Microsoft. The referee has to be migrated
to the released version of RDS 2008. When it becomes available you will be able to 
    download it from the Microsoft web site.
</p>

<h3>Sumo</h3>
<p>
The Sumo simulation is supported. The referee is supplied in RDS 2008. Note that 
    the Sumo Challenge from the RoboChamps competition is no longer available.
</p>

<h2>Hardware Services</h2>

<h3>Parallax Boe-Bot Services</h3>
<p>
There are services for the Boe-Bot included in this package. They will
work with the original firmware from Parallax, but in order to use the
additional features in the book you will have to download updated
firmware to your Boe-Bot.
</p>

<h3>Robotics Connection Services</h3>
<p>
If you have a Stinger or Traxster robot then you will need
<a href="http://www.promrds.com/Downloads/RoboticsConnection-Jan2009.zip">updated services</a>.
These are supplied &quot;as is&quot; with the permission of
Robotics Connection. You should check 
    the Robotics Connection web site for a later version.
</p>

<h2>Package Folder</h2>
<p>
    TThe kit has a folder called <b>Package</b> that contains a command script and a 
    text file. These are used to build the DssDeploy package for anyone who is 
    interested in how it works.
</p>

<h2>Media Folder</h2>
<p>
    TThe kit has a folder called <b>Media</b> that contains all of the image and mesh 
    files required by the simulations. These should be copied into the <b>
    store\media</b> 
    folder on your RDS installation automatically.
</p>

<h2>Bin Folder</h2>
<p>
    TThe kit has a folder called <b>bin</b> that contains all the command scripts 
    used to run the services. These scripts can be copied into the <b>bin</b> folder 
    under your RDS installation point. This will make it easier for you to run the 
    various samples.
</p>

<h1>Notes on Changes</h1>
<p>
    TheThe samples were first migrated using the <b>DssProjectMigration</b> tool. Then 
    a variety of different changes had to be applied to the code to make it conform 
    with RDS 2008. Several of these changes are listed below because you might find 
    them useful in your own projects.
</p>
<h2>References</h2>
<p>
Because some of the MRDS DLLs are now in the GAC (Global Assembly Cache),
their names have changed. Also, you will notice that the references are set up
with Specific Version set to true. Please ignore
the advice in the book that says to set this to
false for the following DLLs:<br />
<tt>
Microsoft.Ccr.Adapters.WinForms<br />
Microsoft.Ccr.Core<br />
Microsoft.Dss.Base<br />
Microsoft.Dss.Runtime<br />
</tt>
These will be correctly updated if you run DssProjectMigration.
</p>
<p>The functionality of DssCmdArgs.DLL is now incorporated into Microsoft.Dss.Tools.DLL.
Most people did not use this DLL.
</p>

<h2>DssProxy</h2>
<p>
DssProxy (which is responsible for Proxy Generation) has been
completely rewritten. If you see an error that DssProxy exited
with error code 10, please look in the Output window (not the
Errors window) to see if you can locate the relevant error message(s).
The following paragraphs show some of the errors that were encountered
during the upgrade.
</p>
<p>
<b>DssProxy Error message:</b><br />
<tt>
The contract of the '_brickPort' partner of service 
ProMRDS.Robotics.Integrator.Drive.IntegratorDriveService does not contain a definition for 
ProMRDS.Robotics.GenericBrick.Proxy.GenericBrickOperations.
</tt>
</p>
<p>
This problem occurred because the contract was specified as a string, not using a reference:<br />
<tt>
//[Partner("Integrator", Contract = "http://www.promrds.com/contracts/2008/01/integrator.html", CreationPolicy = 
PartnerCreationPolicy.UseExisting, Optional = false)]<br />
[Partner("Integrator", Contract = brick.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.UseExisting, Optional = false)]<br />
private brick.GenericBrickOperations _brickPort = new brick.GenericBrickOperations();<br />
</tt>
</p>
<p>
<b>DssProxy Error message:</b><br />
<tt>
Invalid URI: The format of the URI could not be determined.
</tt>
</p>
<p>
This problem occurred because the format of a DssCategory must now
be a URI. So for example, "SumoPlayer" is not acceptable:<br />
<tt>
// A category must be in the format of a URI<br />
[DssCategory("http://www.promrds.com/contacts/SumoPlayer.htm")]<br />
</tt>
</p>
<p>
<b>DssProxy Error message:</b><br />
<tt>
The type ProMRDS.Simulation.QuadDifferentialDrive.DriveDifferentialFourWheelState is used as a data contract, or message type, or as a part or base type of a data contract or message type but has no DataContract attribute.
</tt>
</p>
<p>
This problem occurred because the [DataContract] attribute was missing
from a State class. DssProxy makes much more stringent checks now.
</p>
<p>
<b>DssProxy Error message:</b><br />
<tt>
The property 'CommandType' on type SSC32Command is read-only. Properties must support read and write.
</tt>
</p>
<p>
This problem occurred because properties can no longer be read-only. To create a
property that is effectively read-only, you need to add a Set method to
the class that does nothing:<br />
<tt>
Set { }
</tt>
</p>
<h2>Other Changes</h2>
<p>
The ServiceInfoType method HttpUri() is now obsolete. Because it was
mostly used in Log messages, it can be replaced by the ServiceInfo.HttpServiceAlias property
which is the name of the service. This is only cosmetic, but if you
have set "Warnings as Errors" then your code will not compile.
</p>
<p>
When sending notifications to a specific client, such as during the initial
subscription, the syntax has changed:<br />
<tt>
base.SendNotification&lt;Replace&gt;(_subMgr, request.Subscriber, _state);
</tt><br />
should be replaced with:<br />
<tt>
base.SendNotificationToTarget&lt;Replace&gt;(request.Subscriber, _subMgr, _state);
</tt>
</p>
<p>
Camera entities in simulation need to be Attached Children in order for them
to work properly, e.g.<br />
<tt>_entity.CameraModel = simengine.CameraEntity.CameraModelType.AttachedChild;
</tt>
</p>
<p>
When extracting form data from a Http Post request, the syntax has changed:<br />
<tt>
ReadFormData readForm = new ReadFormData(httpPost.Body.Context);<br />
</tt>
must be changed to:<br />
<tt>
ReadFormData readForm = new ReadFormData(httpPost);
</tt>
</p>
    <p>
        DssProxy now checks Contract Identifiers to see if they contain mixed case or 
        spaces. Therefore all Contract Identifiers were converted to lowercase and the 
        manifests modified to match.</p>

<h1>Legal Stuff</h1>
<p>
The software has been designed so that it should not conflict with any existing RDS services.
Please see the <a href="Licence.htm">Licence Agreement</a> for details of the terms of use.
</p>
<p>
The <a href="http://www.roboticsconnection.com">RoboticsConnection</a> services are required to use a Stinger robot and must be
installed separately. They are provided with the permission of RoboticsConnection.
</p>
<p>
The Boe-Bot services are based on code from <a href="http://www.parallax.com">Parallax</a>.
This code is used with permission.
</p>
<p>
The Lynxmotion L6 Arm services are based on code from <a href="http://www.lynxmotion.com">Lynxmotion</a>.
This code is used with permission.
</p>
</div>

<hr />
<div class="footer">
Page maintained by:
<a href="m&#97;&#105;&#108;t&#111;:webmaster&#64;promrds&#46;com">webmaster&#64;promrds.com</a><br />
Last Updated: Jul-2009
</div>

</body>
</html>
